class Foo{
    constructor(public name:string){}
}

class Bar{
    constructor(public name:string){}
}

let foo=new Foo('foo')
let bar=new Bar('bar')
foo=bar